package cn.seecoder.ai.service;

import cn.seecoder.ai.model.vo.DeploymentVO;
import cn.seecoder.ai.model.vo.PredictionVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author fanyanpeng
 * @date 2023/4/22 20:15
 */
public interface DeploymentService {


    void checkDeploymentStateSync();

    /**
     * 获取用户的部署历史
     * @author   fanyanpeng
     * @date 2023/4/22 20:17
     * @param userId
     * @return java.util.List<cn.seecoder.ai.model.vo.DeploymentVO>
     */
    public List<DeploymentVO> getDeploymentVOList(Integer userId);

    /**
     * 获取模型的部署历史
     * @author   fanyanpeng
     * @date 2023/4/22 20:17
     * @param userId
     * @param modelId
     * @return java.util.List<cn.seecoder.ai.model.vo.DeploymentVO>
     */
    public List<DeploymentVO> getDeploymentVOList(Integer userId, Integer modelId);

    /**
     * 获取单个部署的详细信息
     * @author   fanyanpeng
     * @date 2023/4/22 20:19
     * @param userId
     * @param predictionId
     * @return cn.seecoder.ai.model.vo.DeploymentVO
     */
    public DeploymentVO getDeploymentVO(Integer userId, Integer predictionId);



    public DeploymentVO renewDeploymentVO(DeploymentVO deploymentVO);

    /**
     * 取消部署一个模型
     * @author   fanyanpeng
     * @date 2023/4/22 20:19
     * @param userId
     * @param deploymentId
     * @return cn.seecoder.ai.model.vo.DeploymentVO
     */
    public DeploymentVO unDeploy(Integer userId,Integer deploymentId);

    /**
     * 重新部署一个模型：重新获取部署对应的模型，进行加载
     * @author   fanyanpeng
     * @date 2023/4/22 20:19
     * @param userId
     * @param deploymentId
     * @return cn.seecoder.ai.model.vo.DeploymentVO
     */
    public DeploymentVO reDeploy(Integer userId,Integer deploymentId);


    /**
     * 使用部署的模型：取出模型，调用预测服务，返回
     * @author   fanyanpeng
     * @date 2023/4/22 20:19
     * @param userId
     * @param deploymentId
     * @return cn.seecoder.ai.model.vo.DeploymentVO
     */
    public PredictionVO useDeployedModel(Integer userId, Integer deploymentId, Integer fileInfoId);



    /**
     * 异步调用部署方法
     * @author   fanyanpeng
     * @date 2023/4/23 0:46
     * @return
     */
    public void asyncDeploy(Integer deploymentId);


    PredictionVO useDeployedModelWithFile( Integer deploymentId, MultipartFile file);
}
